package face;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class One {
    public static void main(String[] args) {
        int[] arr = {1,1,2};
        int[] ans = process(arr);
        for (int a:ans) {
            System.out.println(a);
        }
    }
    public static int[] process(int[] arr){
        HashSet<Integer> set = new HashSet<Integer>();
        for (int a:arr) {
            set.add(a);
        }
        int[] ans = new int[set.size()];

        Iterator<Integer> iterator = set.iterator();
        int i = 0;
        while (iterator.hasNext()){
            ans[i++] = iterator.next();
        }
        return ans;
    }
}
